package main

import (
	"context"
	"os"
	"week13/configs"
	"week13/internal/service"
	"week13/log"
)


func main() {
	var err error
	dir := "C:\\Users\\03\\Desktop\\training-camp\\week13\\configs\\json\\app.json"
	f, err := os.Open(dir)
	if err !=nil {
		log.Fatal("start admin err",err.Error())
	}
	defer f.Close()
	appConfigs := configs.LoadAppConfigs(f)
	if _,ok := appConfigs["admin"];!ok {
		log.Fatal("admin config error")
	}
	server := service.NewAdminServer(appConfigs["admin"])
	server.Run(context.Background())
}

